//
//  XTMatchTableViewCell.m
//  BeautifulHome
//
//  Created by dlios on 15-5-13.
//  Copyright (c) 2015年 ACE. All rights reserved.
//

#import "XTMatchTableViewCell.h"

@implementation XTMatchTableViewCell

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (void)dealloc
{
    [_background release];
    [_idNameLabel release];
    [_headPortrait release];
    [super dealloc];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.background = [[UIImageView alloc] init];
        [self addSubview: _background];
        self.idNameLabel = [[UILabel alloc] init];
        self.idNameLabel.textColor = [UIColor whiteColor];
        [self addSubview:_idNameLabel];
        self.headPortrait = [[UIImageView alloc] init];
        [self addSubview: _headPortrait];
        [_headPortrait release];
        [_background release];
        [_idNameLabel release];
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.background.frame = CGRectMake(2.5, 5, self.frame.size.width - 5, self.frame.size.height - 5);
    self.background.layer.masksToBounds = YES;
    self.background.layer.cornerRadius = 5;
    self.headPortrait.frame = CGRectMake(20, 220, 50, 50);
    self.headPortrait.layer.masksToBounds = YES;
    [self.headPortrait.layer setCornerRadius:25];
    self.idNameLabel.frame = CGRectMake(90, 220, 190, 60);

}
@end
